<!DOCTYPE html>
<!--
     SPDX-License-Identifier: CC-BY-SA-4.0
     SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC.
-->
<!-- Page last generated 2025-02-20 03:16:15 +0000 -->
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Zynq ZCU102 | seL4 docs</title>

    <!-- Our stylesheet and theme stylesheet.  Contains bootstrap. -->
    <link rel="stylesheet" href="/assets/css/style.css" type="text/css">
    <!-- Font awesome -->
    <link href="https://use.fontawesome.com/releases/v5.0.8/css/all.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
    <!-- Pygments syntax highlighting  -->
    <link rel="stylesheet" href="/assets/css/highlighting/trac.css" type="text/css">
    <link rel="icon" type="image/x-icon" href="/assets/favicon.ico"><script defer data-domain="docs.sel4.systems"
	    src="https://analytics.sel4.systems/js/script.js"></script></head>

  <body class="container-fluid">

    



<header>
  <ul class="row menu">
    <li class="col-xs-12 col-md-2" >
            <a href="https://sel4.systems" class="skip-icon">
              <img class="img-responsive" src="/assets/logo-text-white.svg" alt="seL4 logo" />
            </a>
    </li>
    <li class="col-xs-12 col-md-10 menu">
      <nav aria-label="Banner links">
        <h2><a href="/Resources" />Resources</h2>
        <h2><a href="/processes" />Contributing</a></h2>
        <h2><a href="/projects" />Projects</h2>
        <h2><a href="/Tutorials" />Tutorials</h2>
        <iframe title="DuckDuckGo search bar" src="https://duckduckgo.com/search.html?site=docs.sel4.systems&prefill=Search%20sel4.systems" style="overflow:hidden;margin-bottom:10px; padding:0;height:40px;float:right;border-width: 0px"></iframe>
      </nav>
    </li>
  </ul>
  <div class="clear"></div>
  
<div class="breadcrumbs bootstrap hidden-sm-down">
  <nav class="sel-breadcrumb" aria-label="Breadcrumb" >
    <ol class=" list-unstyled" vocab="http://schema.org/" typeof="BreadcrumbList">
      
      
        

        

        <li class="breadcrumb-item" property="itemListElement" typeof="ListItem">
            <a property="item" typeof="WebPage" href="/">
              <span property="name"><b>seL4 Docs</b></span>
            </a>
            <meta property="position" content="1" />
        </li>
      
        

        

        <li class="breadcrumb-item" property="itemListElement" typeof="ListItem">
            <a property="item" typeof="WebPage" href="/Hardware/">
              <span property="name"><b>Supported platforms</b></span>
            </a>
            <meta property="position" content="2" />
        </li>
      
        

        
          <li class="breadcrumb-item" property="itemListElement" typeof="ListItem">
            <span property="name">Zynq ZCU102</span>
            <meta property="position" content="3" /></li>
          
    </ol>
  </nav>
  <nav class="sel-version" aria-label="Current Versions">
    <ol class="list-unstyled">
      <li class="list-unstyled text-right" style="margin-left:auto; padding:0rem 0rem;">
        Current versions:</li>
      <li class="list-unstyled text-right">
      <a href="/releases/sel4/13.0.0"><b>seL4-13.0.0</b></a></li>
      <li class="list-unstyled text-right">
      <a href="/releases/microkit/1.4.1"><b>microkit-1.4.1</b></a></li>
      <li class="list-unstyled text-right">
      <a href="/releases/camkes/camkes-3.11.0"><b>camkes-3.11.0</b></a></li>
      <li class="list-unstyled text-right">
      <a href="/releases/capdl/0.3.0"><b>capDL-0.3.0</b></a></li>
      </ol>
  </nav>
  <div class='clear'></div>
</div>


</header>

    <main>
      <div class="row">
  <div class="hidden-xs col-sm-4 col-md-3 col-lg-2">
    


<div class="sidebar">
















</div>

  </div>
  <div class="col-sm-8 col-md-9 col-lg-8 main">
    
    <div class="content">
      <h1 id="zynq-zcu102">Zynq ZCU102</h1>

<p>The board is Zynq UltraScale MPSoC ZCU102 Eval Kit, Rev 1.1
The port also works on the ZCU106 evaluation kit.</p>

<p>Xilinx maintains online material, including designs and documentation <a href="http://www.xilinx.com/zcu102">here</a>.</p>

<h2 id="building">Building</h2>
<h3 id="sel4test">seL4test</h3>

<p>Checkout the sel4test project using repo as per <a href="/seL4Test">seL4Test</a></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>repo init <span class="nt">-u</span> https://github.com/seL4/sel4test-manifest.git
repo <span class="nb">sync
mkdir </span>cbuild
<span class="nb">cd </span>cbuild
../init-build.sh <span class="nt">-DPLATFORM</span><span class="o">=</span>zcu102 <span class="nt">-DAARCH64</span><span class="o">=</span>1
<span class="c"># The default cmake wrapper sets up a default configuration for the target platform.</span>
<span class="c"># To change individual settings, run `ccmake` and change the configuration</span>
<span class="c"># parameters to suit your needs.</span>
ninja

</code></pre></div></div>

<p>Generated binaries can be found in the <code class="language-plaintext highlighter-rouge">images/</code> directory.</p>

<p>The ZCU102 also supports AArch32 mode. If you choose to build the AArch32 kernel,
please be sure to pass <code class="language-plaintext highlighter-rouge">-DAARCH32=1</code> instead of <code class="language-plaintext highlighter-rouge">-DAARCH64=1</code>.</p>

<h2 id="arm-trusted-firmware-atf">ARM Trusted Firmware (ATF)</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/Xilinx/arm-trusted-firmware.git
<span class="nb">cd </span>arm-trusted-firmware
make <span class="nv">PLAT</span><span class="o">=</span>zynqmp <span class="nv">RESET_TO_BL31</span><span class="o">=</span>1 <span class="nv">CROSS_COMPILE</span><span class="o">=</span>aarch64-linux-gnu-
</code></pre></div></div>
<p>Generated ELF file can be found at <code class="language-plaintext highlighter-rouge">build/zynqmp/release/bl31/bl31.elf</code>.</p>

<h2 id="u-boot">U-Boot</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/Xilinx/u-boot-xlnx.git
<span class="nb">cd </span>u-boot-xlnx
make xilinx_zynqmp_virt_defconfig
<span class="c"># Use "make menuconfig" to open the configuration interface, change the value</span>
<span class="k">in</span> <span class="s2">"Default Device Tree"</span> to <span class="s2">"zynqmp-zcu102-rev1.0"</span> or <span class="s2">"zynqmp-zcu106-rev1.0"</span>
make <span class="nv">CROSS_COMPILE</span><span class="o">=</span>aarch64-linux-gnu-
</code></pre></div></div>
<p>If you use gcc &gt; 10, apply the following patch before compiling:</p>
<div class="language-patch highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gh">diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
index fd825ebba6..24af549977 100644
</span><span class="gd">--- a/scripts/dtc/dtc-lexer.l
</span><span class="gi">+++ b/scripts/dtc/dtc-lexer.l
</span><span class="p">@@ -38,7 +38,6 @@</span> LINECOMMENT	"//".*\n
 #include "srcpos.h"
 #include "dtc-parser.tab.h"
<span class="err">
</span><span class="gd">-YYLTYPE yylloc;
</span> extern bool treesource_error;
 
 /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
</code></pre></div></div>
<p>If you choose to use the AArch32 kernel, apply the following patch:</p>
<div class="language-patch highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gh">diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 52b08c4dbe..c9ebd33d15 100644
</span><span class="gd">--- a/board/xilinx/zynqmp/zynqmp.c
</span><span class="gi">+++ b/board/xilinx/zynqmp/zynqmp.c
</span><span class="p">@@ -358,7 +358,7 @@</span> unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
 		smp_kick_all_cpus();
 		dcache_disable();
 		armv8_switch_to_el1(0x0, 0, 0, 0, (unsigned long)entry,
<span class="gd">-				    ES_TO_AARCH64);
</span><span class="gi">+				    ES_TO_AARCH32);
</span> 	} else {
 		printf("FAIL: current EL is not above EL1\n");
 		ret = EINVAL;
</code></pre></div></div>
<p>Generated ELF file is <code class="language-plaintext highlighter-rouge">u-boot.elf</code>.</p>

<p>Upstream U-Boot also works; instructions are <a href="https://u-boot.readthedocs.io/en/stable/board/xilinx/zynqmp.html">here</a></p>

<h2 id="development-environment">Development Environment</h2>

<p>Install Vivado SDK or Vitis Software Platform from Xilinx <a href="http://www.xilinx.com/support/download.html">here</a>
(Requires a free Xilinx account). The following instructions are based on Vivado SDK v2019.1</p>

<h3 id="first-stage-boot-load-fsbl">First stage boot load (FSBL)</h3>

<p>Open Vivado SDK, create a new application project.</p>
<ul>
  <li>OS platform: standalone</li>
  <li>Hardware Platform: ZCU102_hw_platform</li>
  <li>Processor: psu_cortexa53_0</li>
  <li>Language: C</li>
  <li>Compiler: 64-bit</li>
  <li>Hypervisor Guest: No</li>
  <li>Template: Zynq MP FSBL</li>
</ul>

<p>Generated ELF file is in <code class="language-plaintext highlighter-rouge">Debug</code> directory</p>

<h3 id="pmu-firmware">PMU firmware</h3>

<p>Open Vivado SDK, create a new application project.</p>
<ul>
  <li>OS platform: standalone</li>
  <li>Hardware Platform: ZCU102_hw_platform</li>
  <li>Processor: psu_pmu_0</li>
  <li>Language: C</li>
</ul>

<p>Generated ELF file is in <code class="language-plaintext highlighter-rouge">Debug</code> directory</p>

<h2 id="booting-via-jtag">Booting via JTAG</h2>

<p>Set DIP switch (SW6) to JTAG boot (on, on, on, on).</p>

<p>Start the Xilinx debug tool (shipped with Vivado SDK):</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>xsct <span class="nt">-nodisp</span>
</code></pre></div></div>
<p>Upload files to the board using XSCT prompt:</p>
<div class="language-tcl highlighter-rouge"><div class="highlight"><pre class="highlight"><code>connect
targets -set -filter <span class="p">{</span>name =~ <span class="s2">"PSU"</span><span class="p">}</span>
mwr 0xffca0038 0x1ff
targets -set -filter <span class="p">{</span>name =~ <span class="s2">"MicroBlaze*"</span><span class="p">}</span>
dow pmufw.elf
con
target -set -filter <span class="p">{</span>name =~ <span class="s2">"Cortex-A53 #0*"</span><span class="p">}</span>
rst -processor
dow fsbl.elf
con
dow bl31.elf
con
dow u-boot.elf
con
<span class="c"># Load the seL4 image in ELF format, the file can be found in the sel4test build directory
</span>dow elfloader/elfloader
con
</code></pre></div></div>

<h2 id="booting-via-sd-card">Booting via SD Card</h2>

<p>Get an SD card can format it with FAT32.</p>

<p>Set DIP switch (SW6) to SD boot (off, off, off, on)</p>

<p>Create a output.bif file with the following content:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>the_ROM_image:
{
    [bootloader, destination_cpu = a53-0] fsbl.elf
    [pmufw_image] pmufw.elf
    [destination_cpu = a53-0, exception_level = el-3] bl31.elf
    [destination_cpu = a53-0, exception_level = el-2] u-boot.elf
}
</code></pre></div></div>
<p>Generate the bootable binary:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bootgen <span class="nt">-arch</span> zynqmp <span class="nt">-image</span> output.bif <span class="nt">-w</span> on <span class="nt">-o</span> BOOT.bin
</code></pre></div></div>
<p>Copy BOOT.bin to the SD card</p>

<p>Insert the SD card into ZCU102 then power on the board, and drop into the U-Boot
prompt. When you’re at the prompt, type the following to load the ELF file generated
from builidng seL4test:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>fatload mmc 0 0x8000000 sel4test-driver-image-arm-zynqmp
bootelf 0x8000000
</code></pre></div></div>


    </div>
  </div>
</div>

    </main>
    


<footer class="site-footer">

  <h2 class="footer-heading">seL4 docs</h2>

  <div class="footer-col-wrapper">

    <div class="col-md-2">
      



<ul class="social-media-list">
  <li><a href="https://github.com/sel4"><i class="fab fa-github"></i> <span class="username">sel4</span></a></li><li><a href="https://github.com/sel4proj"><i class="fab fa-github"></i> <span class="username">sel4proj</span></a></li>
</ul>

    </div>

    <div class="col-md-8">
      <ul class="list-unstyled">
        <li>
          This site is for displaying seL4 related documentation.  Pull requests are welcome.
        </li>
        
          <li>
            Site last updated: Fri Feb 7 10:17:38 2025 +1100 ee78c8857c
          </li>
          <li>
                Page last updated: Tue Jan 14 15:56:06 2025 +1100 f28f1dfa66
          </li>
        
      </ul>
    </div>
    <div class="col-md-2">
<a href="https://github.com/seL4/docs/blob/master/Hardware/ZCU102.md">View page on GitHub</a>
      <br />
      <a href="https://github.com/seL4/docs/edit/master/Hardware/ZCU102.md">Edit page on GitHub</a>
      <br />
      <a href="/sitemap">Sitemap</a>
    </div>

  </div>

</footer>

  </body>
</html>
